<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    function aaa(a) {
        var b = 5;

        function bbb() {
            a++;
            b++;
            alert(a);
            alert(b);
        }

        return bbb;
    }

    var ccc = aaa(2);

    ccc();
    ccc();
</script>
</body>
</html>